$.get("goodsAndShoppingCart/getGoodsList.php",
{
"typeId":"013"
},
function(data){
  // for(let i=0;i<data.len)
  let json = JSON.parse(data)
	console.log(json)
  let a = json.length
  for(let i= 0;i<a;i++){
    $(".ba-gongge").append('<div><div class="ba-gonggetu"><img src="img/1/da1.png" alt=""></div><div class="ba-gonggeming">DJl Mavic 3</div><div class="ba-gonggejiage"> ￥12888</div></div>')

    $(".ba-gonggetu>img").eq(i).attr("src", `img/liebiao/${json[i]["goodsImg"]}`);
    $(".ba-gonggeming").eq(i).html(`${json[i]["goodsName"]}`)
    $(".ba-gonggejiage").eq(i).html(`￥${json[i]["goodsPrice"]}`)

    // sessionStorage.setItem('goodsId',`${json[i]["goodsId"]}`)
    // sessionStorage.setItem(json)
    // 跳转
    $(".ba-gonggetu>img").eq(i).click(function(){

      window.location.href="xianqing.html"
      sessionStorage.setItem('goodsId',`${json[i]["goodsId"]}`)
      
    })

  }
});

